< previous page page_406 next page >

Page 406
adjusts to the new form shape. Finally, click the Add button to add a new record to the State/Province table. You see the input controls become enabled and most of the button bar becomes disabled (see Figure 10.8).
0406-01.jpg
Figure 10.7.
Running the new State/
Province Validation form.
0406-02.jpg
Figure 10.8.
Adding a new record to
 the State/Province table.
You can enter values in both fields and then click the Save button or the Cancel button to undo the add operation. Click Cancel for now. Test out the form by clicking the Browse and Find buttons. Add a record, edit it, and then delete it. You now have a fully functional data entry form, and you added less than 30 lines of Visual Basic code to the master form!
Summary
Today you learned how to write data entry forms using Visual Basic code. These topics were covered: record search routines, the creation of a procedure library to handle all data entry processes, and the creation of a working data entry form for the CompanyMaster project.
You learned how to perform single-record searches using the three search methods:
· The Move methods for browsing the dataset
· The Seek method for indexed table objects
· The Find methods for non-table objects (Dynasets and Snapshots)
You created an OLE Server library to handle adding, editing, deleting, reading, writing, and locating records in datasets. These routines were written as a generic DLL that you can insert into all Visual Basic programs you write in the future.
You used the new library to add a new form to the CompanyMaster database project. This new form reads a dataset and enables the user to update and browse the table. This new data entry form was built using less than 30 lines of Visual Basic code.

 
< previous page page_406 next page >

If you like this book, buy it!